import 'package:flutter/material.dart';

class ContextProvider {
  ContextProvider._();

  static final ContextProvider _instance = ContextProvider._();

  /// 路由键
  final GlobalKey<NavigatorState> _navigatorKey = GlobalKey();

  /// 用于保存navigatorKey的键
  static GlobalKey<NavigatorState> get globalKey => _instance._navigatorKey;

  /// 全局context
  static BuildContext? get context => _instance._navigatorKey.currentContext;
}
